<DynamicPageBanner title="{intl.blockedUsers}" icon="#fa-ban" />
{#if $isUserLoggedIn }
  <AccountsListPage {accountsFetcher} {accountActions} />
{/if}
<script>
  import AccountsListPage from '../_components/AccountsListPage.html'
  import { store } from '../_store/store.js'
  import { getBlockedAccounts } from '../_api/blockedAndMuted.js'
  import DynamicPageBanner from '../_components/DynamicPageBanner.html'
  import { setAccountBlocked } from '../_actions/block.js'

  export default {
    data: () => ({
      accountActions: [
        {
          icon: '#fa-unlock',
          label: 'intl.unblock',
          onclick: (accountId) => setAccountBlocked(accountId, false, true)
        }
      ]
    }),
    computed: {
      accountsFetcher: ({ $currentInstance, $accessToken }) => () => getBlockedAccounts($currentInstance, $accessToken)
    },
    store: () => store,
    components: {
      AccountsListPage,
      DynamicPageBanner
    }
  }
</script>
